﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using PowerCreator.LMS.Common.Script;
using PowerCreator.LMS.Common.Utils;

using PowerCreator.LMS.DL.Project.Entity;
using PowerCreator.LMS.Web.DL.Project;



public partial class sysadmin_CourseManager_ShowPinion : PowerCreator.LMS.Web.Base.BasePage
{
    protected PowerCreator.LMS.Web.Config.WebConfig config = new PowerCreator.LMS.Web.Config.WebConfig();
    PowerCreator.LMS.ViewQuery.ViewQuery ov = new PowerCreator.LMS.ViewQuery.ViewQuery();
    TOPinion opPinion = new TOPinion();
    private PowerCreator.LMS.Web.DL.User.LoginEntity login = new PowerCreator.LMS.Web.DL.User.LoginEntity();
    private string url = "UserLogin.aspx";
    protected int ID = 0;

    protected void Page_Load(object sender, EventArgs e)
    {
        //if (IsLicensed(PowerCreator.LMS.Action.Core.ActionInfo.AddJob))
        //{
        //    Script.RedirectURL(GetRefUrl());
        //}
        if (!IsPostBack)
        {
            if (Request.QueryString["ID"] != null)
            {
                ID = int.Parse(Request.QueryString["ID"].ToString());
                if (ID != 0)
                {
                    ViewState["ID"] = ID.ToString();
                    
                    BinderPage(ID);
                }
            }
        }
    }

    private void BinderPage(int id)
    {
        VOTOPinion vo = new VOTOPinion();
        vo = opPinion.Load(id);
        lab_title.Text = vo.Title;
        lab_Content.Text = vo.Content;
        lbl_Scroe.Text = vo.Score.ToString();

        PowerCreator.LMS.DL.Project.Entity.VOTOLearner vol = new VOTOLearner();
        TOLearner obj = new TOLearner();
        vol = obj.Load(vo.Creator);
        lbl_ShowpinionCreator.Text = vol.Name;

    }

}
